package eraserhead.xml.response;

import org.w3c.dom.Node;

import xml.Message;
import client.IMessageHandler;
import eraserhead.boundary.DecisionGUI;
import eraserhead.xml.XmlNode;

/**
 * Response handler for Create
 * @author Michael Checca, Zhaolong Li
 */
public class CreateResponse implements IMessageHandler {
	
	@Override
	public void process(Message response) {

		Node create = XmlNode.findNode(response.contents, "createResponse");
		if (create != null) {
			String id = XmlNode.getAttribute(create, "id");
			DecisionGUI.getInstance().getModel().setId(id);
			DecisionGUI.getInstance().setEventID(id);
		}

	}
}
